//
//  LabelCell.m
//  趣·美食
//
//  Created by dllo on 15/9/29.
//  Copyright (c) 2015年 金旭. All rights reserved.
//

#import "LabelCell.h"


@interface LabelCell ()

@property (nonatomic, strong) UILabel *label;


@end

@implementation LabelCell


- (instancetype)initWithFrame:(CGRect)frame {
    
    self = [super initWithFrame:frame];
    
    if (self) {
        
        self.label = [[UILabel alloc] init];
        self.label.textAlignment = NSTextAlignmentCenter;
        self.label.backgroundColor = [UIColor whiteColor];
        self.label.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:self.label];

        
    }
    
    return self;
}


- (void)setClassModel:(GFClassifyModel *)classModel {
    
    if (_classModel != classModel) {

        _classModel = classModel;
    }
    
    self.label.text = self.classModel.name;
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes {
    
    self.label.frame = CGRectMake(0, 0, ScreenWidth / 375 * 111, ScreenWidth / 375 * 50);
    self.label.layer.masksToBounds = YES;
    self.label.layer.cornerRadius = ScreenWidth / 375 * 5;
    
}

@end
